package edu.hrbu.spring.service.impl;

import edu.hrbu.spring.mapper.DeptMapper;
import edu.hrbu.spring.pojo.Dept;
import edu.hrbu.spring.service.DeptService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 徐登宇
 */
@Service
public class DeptServiceImpl implements DeptService {

    @Resource(name = "deptMapper")
    DeptMapper deptMapper;

    @Override
    public List<Dept> getAllDept() {
        return deptMapper.getDeptList();
    }

    @Override
    public boolean save(Dept dept) {
        return deptMapper.insert(dept)==1;
    }
}
